package com.javatest.springbootactuator.health;

import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.stereotype.Component;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/4/25 21:45
 */
@Component
public class MyAppHealthIndicator implements HealthIndicator {

    //自定义的检查方法
    //com.javatest.springbootactuator.health.up().build()代表健康
    @Override
    public Health health() {
        return Health.down().withDetail("msg", "服务异常").build();
    }
}
